<template>
  <Maptalks :mapOnLoadCB="mapOnLoadCB"></Maptalks>
</template>

<script>
import Maptalks from "@/components/common/Maptalks.component.vue"
import MapLayerConst from "@/const/MapLayerConst"

export default {
  name: "AddLine.component",
  components: {Maptalks},
  setup() {

    let mapOnLoadCB = (map) => {

      let line = new maptalks.LineString([
        [121.475031060928, 31.2611187865471],
        [121.47940842604, 31.263466566376],
        [121.481768769973, 31.2649338991092],
        [121.483871621841, 31.2638700851521],
      ], {
        symbol: {
          "lineColor": "#f00",
          "lineWidth": 8
        }
      });
      map.setZoom(14)
      new maptalks.VectorLayer(MapLayerConst.MAP_LINE_LAYER).addGeometry(line).addTo(map);

    };

    return {
      mapOnLoadCB
    }
  }
}
</script>

<style scoped>

</style>